<template>
	<view>
		<hx-navbar :border="false" :centerSlidiSwitch="true" :rightSlidiSwitch="false" :fixed="true"
			:backgroundColor="[255, 193, 7]" :pageScroll.sync="scrollData">
			<view style="text-align: center;width: 100%;"><text>提交订单</text></view>
			<view slot="centerAfter" style="text-align: center;width: 100%;"><text>选择收货地址 ></text></view>
		</hx-navbar>
		<view class="head tab-right-active">
			<view class="tab-box" v-if="tabIndex > 0">
				<view class="item left" :class="{ active: tabIndex == 1 }" @click="tabIndex = 1">
					<view class="tit-box"><text>配送</text></view>
				</view>
				<view class="item right" :class="{ active: tabIndex == 2 }" @click="tabIndex = 2">
					<view class="tit-box"><text>到店自取</text></view>
				</view>
			</view>
			
		</view>

		<view class="b-r m-t container p12">
			<view class="store">
				<view class="name ">
					<text style="font-weight: bold;font-size: 28rpx;">{{ storeData.data.name }}</text>
					<!-- 标志性位置 ，社区  如：白羊区店，玫瑰园小区 -->
					<text v-if="storeData.data.community">({{ storeData.community }})</text>
				</view>
				<view class="p-bb b-b"></view>
				<view class="goods-box">
					<block v-for="(goods, i) in storeData.shopping_cart" :key="i" v-if="storeData.shopping_cart">
						<view class="goods-item">
							<view class="left">
								<image :src="goods.img" mode="aspectFit"></image>
							</view>
							<view class="right">
								<view class="row1">
									<view class="tit">
										<text class="zk"
											v-if="goods.oldprice && Number(goods.price) < Number(goods.oldprice)">折</text>
										<text>{{ goods.name }}</text>
									</view>
									<view class="old-price" v-if="goods.oldprice">
										<text class="fh">￥</text>
										<text class="lt">{{ goods.oldprice }}</text>
									</view>
									<view class="price">
										<text class="fh">￥</text>
										<text>{{ goods.price }}</text>
									</view>
								</view>
								<view class="row2">
									<text>{{ goods.current_form ? goods.current_form.name : goods.descripe}}</text>
								</view>
								<view class="row3">
									x
									<text>{{ goods.number }}</text>
								</view>
							</view>
						</view>
					</block>
				</view>
				<view class="p-bb b-b"></view>
				<view class="titile" style="font-size: 35rpx;font-weight: bold;">
					代办信息填写:
				</view>
				
				<view class="row" style="display: flex;justify-content: space-around;">
					<view  style="margin-right: 15rpx;font-size: 30rpx;">真实姓名填写：</view>
					<input class="input" @input="nameInput" type="text" placeholder="真实姓名必填"
						placeholder-class="placeholder" :value="nameXF" />
				</view>
				<view class="row" style="display: flex;justify-content: space-around;">
					<view  style="margin-right: 15rpx;font-size: 30rpx;">手机号填写：</view>
					<input class="input" @input="codeInput" type="number" placeholder="手机号填写"
						placeholder-class="placeholder" :value="code" />
				</view>
				<view class="row" style="display: flex;justify-content: space-around;" v-if="typeXu==1||typeXu==3">
					<view  style="margin-right: 15rpx;font-size: 30rpx;">身份证填写：</view>
					<input class="input" @input="codeStuInput" type="text" placeholder="身份证填写"
						placeholder-class="placeholder" :value="codeStu" />
				</view>
				<view class="row" style="display: flex;justify-content: space-around;" v-if="typeXu==3">
					<view  style="margin-right: 15rpx;font-size: 30rpx;">服务密码(仅移动续费必填)：</view>
					<input class="input" @input="codeFuInput" type="number" placeholder="服务密码填写"
						placeholder-class="placeholder" :value="codeFu" />
				</view>
				<view  style="margin-right: 15rpx;font-size: 30rpx;font-size: 35rpx;font-weight: bold;" v-if="typeXu==3">查服务密码方法：
				</view>
				<view  style="margin-right: 15rpx;font-size: 30rpx;padding: 10rpx;" v-if="typeXu==3">注意：服务密码不是宽带密码，需要发送CZMM到10086按提示进行重置
				</view>
				<!-- <view class="row" style="display: flex;justify-content: start;"  v-if="typeXu==3">
					<view class="login__info__item__button tn-cool-bg-color-15--reverse"
						hover-class="tn-hover" :hover-stay-time="150" 
						@click="sendCode()">点击此按钮发送短信查询服务密码</view>
				</view> -->
				<view class="row" style="display: flex;justify-content: start;"  v-if="typeXu==3">
					<view  style="margin-right: 15rpx;font-size: 30rpx;">到期时间填写：</view>
					<view class="text-lg text-red bg-gray" style="padding: 1rpx 10rpx;" @click="showNumberPopup">
						{{chooseLoudong}}</view>
					<view class="text-red" style="flex:1; text-align: end;">必选</view>
				</view>
				<view  style="margin-right: 15rpx;font-size: 30rpx;font-size: 35rpx;font-weight: bold;" v-if="typeXu==3">查续费到期时间方法：
				</view>
				<view  style="margin-right: 15rpx;font-size: 30rpx;padding: 10rpx;" v-if="typeXu==3">在中国移动App里面我的-已订业务查看减免活动失效时间，到期才需要续费
				如果在“已定业务”里面没有查到赠送520的活动或者减免40 1年的活动，说明已经到期了，可以续费参加新活动
				<!-- <image src="../../../static/yidong.jpg" mode="widthFix" @click="checkDao()"></image> -->
				</view>
				<u-picker mode="selector" @confirm="AddressConfirm" v-model="showAddress" :isDefault-selector="[0]"
					:range="selectorAddress"></u-picker>
				
				
			</view>
		
		</view>
		
		<!-- //备注弹窗 -->
		<u-popup mode="center" v-model="showPop">
			<view class="pop_box">
				<textarea class="text-black" auto-focus="true" style="width:100%;height:320rpx;padding: 0 20rpx"
					:focus="isFocus" @input="messageInput" :value="remark" type="textarea" autosize border="false" />
				<view class="pop_btn_box margin-bottom-sm">
					<u-button :custom-style="customStyle" round @click="canclecomment" type="info">取消</u-button>
					<u-button :custom-style="customStyle" round @click="submitcomment" type="info">确定</u-button>
				</view>
			</view>
		</u-popup>
		
		<view class="body-end"></view>

		<view class="foot">
			<view class="left">
				<view class="price">
					<text class="fh">￥</text>
					<text class="txt">{{ totalPrice }}</text>
				</view>
			</view>
			<!-- <view class="center">
				<text>找人付</text>
			</view> -->
			<view class="right" @click="submit"><text>提交订单</text></view>
		</view>
		<!-- //时间选择框 -->
		<u-picker mode="selector" @confirm="timeConfirm" v-model="showTime" :default-selector="[0]" :range="selector">
		</u-picker>
		<u-picker mode="selector" @confirm="NumberYueConfirm" v-model="showNumber" :default-selector="[0]"
			:range="selectorYueNumber"></u-picker>
	</view>
</template>

<script>
	import getDateTime from '../../../common/getdataTime';
	//数据库引入
	const db = uniCloud.database();
	//引入全局变量
	var app = getApp();
	export default {
		data() {
			return {
				showNumber: false,
				selectorYueNumber: ['7月底到期','8月底到期','9月底到期'],
				chooseLoudong:"点击选择到期时间",
				codeFu:'',
				showAddress:false,
				selectorNumber: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
				selector: [],
				selectorAddress: ['12栋东区菜鸟驿站','12栋西区菜鸟驿站','12栋天猫超市旁顺丰快递','教工16栋京东','教工17栋快递点','七食堂下雅迪电动车棚韵达超市','24栋天天快递点','24栋旁菜鸟驿站','七栋负一楼邮政','南三舍韵达快递'],
				code:"",
				codeStu:"",
				nameXF:"",
				addressDeliveryName: '点击选择快递站',
				ispass: "",
				packnum: 0, //打包费
				openid: '',
				textNumber: '1',
				timeGet: '',
				userinfo: {},
				//选择送达时间
				showTime: false,
				showNumber: false,
				timeGive: '未选择(必选)',
				customStyle: {
					width: '150rpx',
					height: '50rpx',
					color: '#ffffff',
					background: 'linear-gradient(45deg, #0081ff, #1cbbb4)'
				},
				isgive: true,
				isFocus: true,
				showPop: false,
				scrollData: {},
				//购物车缓存 Storage 名称
				shoppingCartStorageName: 'shopping_cart',
				//门店信息
				storeData: {},
				//购物车
				shoppCart: [],
				//头部选项卡 参数为 0不显示选项卡,1,2
				tabIndex: 1,
				//收获地址
				addressData: null,
				//手机隐私
				ysStatus: true,
				//优惠券
				couponData: [{
						id: 'ASD2020410003',
						icon: 'icon-ticket_money_fill',
						//标题
						tit: '门店新客立减',
						//说明
						content: '15元商家券',
						//备注
						remark: '满减券和商品折扣可同享',
						//面额
						value: 15
					},
					{
						id: 'ASD2020410001',
						icon: 'icon-ticket_money_fill',
						tit: '商家抵用立减',
						content: '-￥50',
						//面额
						value: 50
					}
				],

				//结算价
				totalPrice: 0,
				//已优惠价
				totalYhPrice: 10,
				//商品数量
				totalNumber: 0,
				delivery: 0,
				remark: '',
				place: "",
				timeGiveSelf: "",
				self: false,
				shanglouPrice: 0,
				codeFu:'',
				typeXu:0
			};
		},
		onLoad(option) {
			let that = this;
			this.packnum = Number(parseFloat(option.packnum).toFixed(2));
			this.qishou = Number(parseFloat(option.qishou).toFixed(2));
			console.log('传过来的骑手费', this.qishou);
			this.openid = option.openid;
			this.place = option.place;
			this.self = option.self;
			this.sign = option.sign;
			that.getGiveTime(this.sign);
			let totalPrice = 0;
			let totalNumber = 0;
			let totalOldPrice = 0;
			if (option.sid) {
				that.typeXu = option.typeXu
				that.delivery = option.delivery;
				if (that.delivery == 3) {
					that.shanglouPrice = 0.0
				} else {
					that.shanglouPrice = 1.0
				}
				that.ispass = option.ispass;
				that.sn = option.sn;
				that.shore_id = option.sid;
				that.storeImg = option.storeImg;
				that.shoppingCartStorageName = 'shopping_cart' + option.sid;
				let carts = uni.getStorageSync(that.shoppingCartStorageName) || [];
				console.log('订单页面获取到的购物车数据', carts);
				if (carts) {
					//根据缓存数据 获取购物车中属于本商店的商品
					for (let i in carts) {
						if (carts[i].data.store_id == option.sid) {
							that.shoppCart = carts[i].shopping_cart;
							that.storeData = carts[i];
							break;
						}
					}
				}
				
				let cj = 0;
				let op = 0;
				let p = 0;
				let num = 0;
				//计算总商品数量和总价
				for (var i in that.shoppCart) {
					p = Number(that.shoppCart[i].price);
					op = Number(that.shoppCart[i].oldprice);
					num = Number(that.shoppCart[i].number);
					totalNumber += num;
					totalPrice += p * num;
					if (op > p) {
						cj += (op - p) * num;
					}
				}
				that.totalPrice = totalPrice + this.packnum ;
				// if (that.self) {
				// 	that.totalPrice = totalPrice + this.packnum;
				// } else {
				// 	that.totalPrice = totalPrice + this.packnum + 1;
				// }

				that.totalPrice = that.numFilter(that.totalPrice);
				that.totalYhPrice = cj;
			}
		},
		onPageScroll(e) {
			this.scrollData = e;
		},
		onShow() {
			let that = this;
			//备注赋值
			that.remark = getApp().globalData.remark;
			// y:年 m:月 d:日 h:时 i:分 s:秒 中间的分割符号可更改
			this.timeGet = getDateTime.dateTimeStr('m-d');
			//返回用户信息和id
			that.getAddressList();
		},
		methods: {
			checkDao(){
				uni.previewImage({
					urls:['../../../static/yidong.jpg'],
					current:0
				})
			},
			NumberYueConfirm(e) {
				this.chooseLoudong = this.selectorYueNumber[Number(e)];
			},
			showNumberPopup() {
				this.showNumber = true;
			},
			sendCode(){
					var msg = plus.messaging.createMessage(plus.messaging.TYPE_SMS);
					msg.to = ['10086'];
					msg.body = 'CZMM';
					plus.messaging.sendMessage( msg );
			},
			AddressConfirm(e) {
				console.log("queren")
				this.chooseDelivery = this.selectorAddress[Number(e)];
				this.addressDeliveryName = this.chooseDelivery;
			},
			// 地区---------------------------------
			codeInput(e) {
				this.code = e.detail.value;
			},
			codeStuInput(e) {
				this.codeStu = e.detail.value;
			},
			codeFuInput(e) {
				this.codeFu = e.detail.value;
			},
			nameInput(e) {
				this.nameXF = e.detail.value;
			},
			getGiveTime(sign){
				let that =this
				if(sign==1){
					db.collection('givetime')
						.get()
						.then(res => {
							console.log('获取到的送达时间', res.result.data);
							let times = [];
							for (var i = 0; i < res.result.data.length; i++) {
								var item = res.result.data[i];
								if (item.data.iskai) {
									times.push(item.data.time);
								}
							}
							if (times.length == 0) {
								that.isgive = false;
							}
							that.selector = times;
							uni.hideLoading();
						});
				}else if(sign==2){
					db.collection('nighttime')
						.get()
						.then(res => {
							console.log('获取到的送达时间', res.result.data);
							let times = [];
							for (var i = 0; i < res.result.data.length; i++) {
								var item = res.result.data[i];
								if (item.data.iskai) {
									times.push(item.data.time);
								}
							}
							if (times.length == 0) {
								that.isgive = false;
							}
							that.selector = times;
							uni.hideLoading();
						});
				}else if(sign==3){
					db.collection('morningtime')
						.get()
						.then(res => {
							console.log('获取到的送达时间', res.result.data);
							let times = [];
							for (var i = 0; i < res.result.data.length; i++) {
								var item = res.result.data[i];
								if (item.data.iskai) {
									times.push(item.data.time);
								}
							}
							if (times.length == 0) {
								that.isgive = false;
							}
							that.selector = times;
							uni.hideLoading();
						});
				}else{
					db.collection('deliverytime')
						.get()
						.then(res => {
							console.log('获取到的送达时间', res.result.data);
							let times = [];
							for (var i = 0; i < res.result.data.length; i++) {
								var item = res.result.data[i];
								if (item.data.iskai) {
									times.push(item.data.time);
								}
							}
							if (times.length == 0) {
								that.isgive = false;
							}
							that.selector = times;
							uni.hideLoading();
						});
				}
			},
			formatDateTime(inputTime) {
				var date = new Date(inputTime);
				var y = date.getFullYear();
				var m = date.getMonth() + 1;
				m = m < 10 ? ('0' + m) : m;
				var d = date.getDate();
				d = d < 10 ? ('0' + d) : d;
				var h = date.getHours();
				h = h < 10 ? ('0' + h) : h;
				var minute = date.getMinutes();
				var second = date.getSeconds();
				minute = minute < 10 ? ('0' + minute) : minute;
				second = second < 10 ? ('0' + second) : second;
				return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
			},
			numFilter(value) {
				// 截取当前数据到小数点后两位
				let realVal = Number(parseFloat(value).toFixed(2));
				return realVal;
			},
			showAddressPopup() {
				this.showAddress = true;
			},
			showNumberPopup() {
				this.showNumber = true;
			},
			timeConfirm(e) {
				console.log(e);
				if (e == '0') {
					this.timeGive = this.selector[0];
				} else if (e == '1') {
					this.timeGive = this.selector[1];
				} else if (e == '2') {
					this.timeGive = this.selector[2];
				} else if (e == '3') {
					this.timeGive = this.selector[3];
				} else if (e == '4') {
					this.timeGive = this.selector[4];
				} else if (e == '5') {
					this.timeGive = this.selector[5];
				}
				console.log("送达时间", this.timeGive)
			},
			NumberConfirm(e) {
				this.textNumber = this.selectorNumber[Number(e)];
			},
			toSelectTime() {
				this.showTime = true;
			},
			toAddress() {
				uni.navigateTo({
					url: '../address/address?openid=' + this.openid
				});
			},
			//请求地址列表
			getAddressList() {
				let that = this;
				uni.showLoading({
					title: "正在获取地址数据..."
				})
				if (app.globalData.shuaxinAddressID == '') {
					console.log("开始请求所有地址", app.globalData.shuaxinAddressID)
					//根据openid请求后端地址信息
					uni.request({
						url: "https://zback.shixiaozhu.work/ShixiaozhuTest/address/getAddress?openid=" + this
							.openid,
						success(res) {
							if (res.data.status == 200) {
								uni.hideLoading()
								that.addressData = res.data.data[0];
								console.log("地址", res)
								that.hasAdress = true;
							} else {
								uni.hideLoading()
							}
						}

					})
				} else {
					console.log("开始请求指定地址", app.globalData.shuaxinAddressID)
					//根据openid请求后端地址信息
					uni.request({
						url: "https://zback.shixiaozhu.work/ShixiaozhuTest/address/getAddressByid?addressId=" +
							app
							.globalData
							.shuaxinAddressID,
						success(res) {
							if (res.data.status == 200) {
								var list = []
								list.push(res.data.data)
								that.addressData = list[0];
								that.hasAdress = true;
								uni.hideLoading()
							}
						}
					})
				}
			},
			submitcomment() {
				//提交备注
				this.showPop = false;
			},
			canclecomment() {
				this.remark = '';
				this.showPop = false;
			},
			//备注内容输入
			messageInput(e) {
				console.log(e.detail.value);
				this.remark = e.detail.value;
			},
			//回复弹窗
			showPopup() {
				uni.navigateTo({
					url: '../remark/remark?' + "remark=" + this.remark
				})
			},
			privacyStatusChange(e) {
				this.ysStatus = e.target.value;
			},
			//提交订单
			submit() {
				let that = this;
				let goodsID = [];
				var issubmit = true;
				for (var i in that.shoppCart) {
					goodsID.push(that.shoppCart[i].id);
				}
				//TODO：开始测试创建
				if (that.nameXF == '') {
					uni.showModal({
						title: '请输入名字',
						success(res) {
							if (res.confirm) {
								return;
							}
						}
					});
					return
				}
				if (that.code == '') {
					uni.showModal({
						title: '请输入手机号',
						success(res) {
							if (res.confirm) {
								return;
							}
						}
					});
					return
				}
				if(that.typeXu==1||that.typeXu==3){
					if (that.codeStu == '') {
						uni.showModal({
							title: '请输入身份证',
							success(res) {
								if (res.confirm) {
									return;
								}
							}
						});
						return
					}
				}
				if(that.typeXu==3){
					if (that.codeFu == ''||that.codeFu.toString().length>6) {
						uni.showModal({
							title: '请输入正确的服务密码',
							success(res) {
								if (res.confirm) {
									return;
								}
							}
						});
						return
					}
					if (that.chooseLoudong == '点击选择到期时间') {
						uni.showModal({
							title: '请输入到期时间',
							success(res) {
								if (res.confirm) {
									return;
								}
							}
						});
						return
					}
				}
				var Xuname = ""
				if(this.typeXu==3){
					that.remark_now = "身份证号："+that.codeStu + "姓名："+that.nameXF+"手机号：" + that.code + "服务密码:"+that.codeFu+ "到期时间:"+that.chooseLoudong
					that.timeGive = that.chooseLoudong
					Xuname = "小助移动续费"
				}else{
					that.remark_now = "身份证号："+that.codeStu + "姓名："+that.nameXF+"手机号：" + that.code 
					Xuname = "小助电信续费"
				}
				
				// 向后台发送 data 进行真实合计，生成订单，并返回订单信息
				let myDate = new Date().Format('yyyy-MM-dd hh:mm:ss');
				var myTime = new Date().Format('hh:mm:ss');
				var time = parseInt(myTime.split(':')[1]) + 5;
				var deloyetime = myDate.split(' ')[0] + ' ' + myTime.split(':')[0] + ':' + time + ':' + myTime
					.split(':')[
						2];
				var timestamp = new Date().getTime();
				// var ktmoney = that.totalPrice - (1 + parseInt(that.qishou) + 1);
				// if (that.self) {
				// 	var ktmoney = that.totalPrice - 1; //暂时先按4块收
				// } else {
				// 	var ktmoney = that.totalPrice - 4; //暂时先按4块收
				// }
				
				console.log("当前价格", that.totalPrice)
				console.log("提现状态", that.delivery)
				if (that.delivery == 3) {
					var ktmoney = parseFloat(that.totalPrice * 0.81).toFixed(2) - 1;
					if(that.storeData.data.store_id=="18390910400"||that.storeData.data.store_id=="18207428929"){
						ktmoney = parseFloat(that.totalPrice * 0.85).toFixed(2) - 1;
					}else if(that.storeData.data.store_id=="13332513618"){
						ktmoney = parseFloat(that.totalPrice * 0.90).toFixed(2) - 1;
					}
					console.log("提现价格", ktmoney)
				} else {
					var testmoney = that.totalPrice - 1
					var ktmoney = parseFloat(testmoney * 0.8).toFixed(2);
					console.log("提现价格", ktmoney)
				}
				// var ktmoney = that.totalPrice*100; //暂时先按4块收
				
				uni.showLoading({
					title: '正在生成订单'
				});
				
				//TODO：要对此处进行商品图片的地址获取
				let content = '';
				for (var i = 0; i < that.shoppCart.length; i++) {
					if (that.shoppCart[i].current_form == undefined) {
						content = content + that.shoppCart[i].name.replace(/\s+/g, "").replace(/\+/gi, "%2B") +
							' ' + that.shoppCart[i]
							.price + ' ' + that
							.shoppCart[i].number + ' ' + that.shoppCart[i].img + ';';
					} else {
						content =
							content +
							that.shoppCart[i].name.replace(/\s+/g, "").replace(/\+/gi, "%2B") +
							'(' +
							that.shoppCart[i].current_form.name.replace(/\s+/g, "").replace(/\+/gi, "%2B") +
							')' +
							' ' +
							that.shoppCart[i].current_form.price +
							' ' +
							that.shoppCart[i].number + ' ' +
							that.shoppCart[i].img + //这个商品的img内容是最后加的，同过空格对数据进行解析，在后端对数据实体进行构造然后插入数据表中
							';';
					}
					console.log("商品内容", content)
				}
				var otype = 5
				
				var data1 = {
					uopenid: that.openid,
					storeId: that.shore_id,
					name: that.nameXF,
					mobile: that.code,
					addressname: Xuname,
					area: "111",
					palce: that.typeXu,
					packNum: that.packnum,
					canshu: that.textNumber,
					remark: that.remark_now,
					money: that.totalPrice,
					ktMoney: ktmoney,
					storeName: Xuname,
					givetime: that.timeGive,
					ispass: that.ispass,
					sn: that.codeFu,       //服务密码
					storeImg: that.codeStu,       //身份证号
					oType: otype,
					content: content,
					isNew:0
				}
				
				//TODO:创建订单开始测试
				uni.request({
					url: "https://zback.shixiaozhu.work/ShixiaozhuTest/order/creatOrder",
					method: "POST",
					header: {
						'content-type': 'application/x-www-form-urlencoded;charset:utf-8'
					},
					data: data1,
					success(res) {
						if(res.data.status==200){
							let tradeNo = res.data.data.orderId
							let expirationTime = res.data.data.expirationTime
							let money = res.data.data.money
							let oid = tradeNo.substring(tradeNo.length - 3)
							uni.hideLoading();
							//假设返回了订单信息，跳转至支付页面
							if(that.typeXu==2){
								var url = 'http://www.73110010.com/weishop/home/index.html?uid=16680806911#';
								window.location.href = url;
							}else{
								uni.redirectTo({
									url: '/pages/order/pay?id=' + tradeNo +
										'&openid=' + that.openid + '&money=' + money +
										"&expirationTime=" + expirationTime + "&store_name=" + that
										.storeData.data.name + "&store_id=" + that.storeData.data
										.store_id
								});
							}
						}else{
							uni.hideLoading();
							uni.showModal({
								title:"创建订单出现异常，请联系食小助wx：shixiaozhu",
								success() {
									return
								}
							})
						}
					}
				})
			}
		}
	};
</script>

<style lang="scss">
	.row {
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
		position: relative;
		padding: 0 30rpx;
		height: 110rpx;
		background: #fff;
	}
	
	.row .tit {
		-webkit-flex-shrink: 0;
		flex-shrink: 0;
		width: 120rpx;
		font-size: 30rpx;
		color: #303133;
	}
	
	.row .input {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		font-size: 30rpx;
		color: #303133;
	}
	
	.row .icon-shouhuodizhi {
		font-size: 36rpx;
		color: #909399;
	}
	
	.isDefault-row {
		margin-top: 16rpx;
	}
	
	.isDefault-row .tit {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
	}
	
	.isDefault-row switch {
		-webkit-transform: translateX(16rpx) scale(0.9);
		transform: translateX(16rpx) scale(0.9);
	}
	
	.pop_box {
		width: 500rpx;
		height: auto;
	}

	.pop_btn_box {
		display: flex;
		justify-content: space-around;
	}

	.text-input {
		width: 100%;
		min-height: 250rpx;
		max-height: 600rpx;
		font-weight: 500;
		background-color: #999999;
	}

	.b-r {
		border-radius: 6px;
	}

	.m-t {
		margin-top: 6px;
	}

	.p-bb {
		margin: 16px 0;
		height: 1px;
		//background:  #E4E7ED;
	}

	.flex-rl {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}

	.container {
		margin-left: 12px;
		margin-right: 12px;
		background-color: #ffffff;
	}

	.p12 {
		padding: 12px;
	}

	.t-top-box {
		display: flex;
	}

	.head {
		background: linear-gradient(to bottom, #ffc107, #f1f1f1);

		padding-top: 20px;

		.tab-box {
			position: relative;
			height: 40px;
			margin: 0 12px;

			.item {
				position: absolute;
				top: 0;
				bottom: 0;
				height: 40px;
				text-align: center;
				font-size: 14px;

				width: 50%;

				.tit-box {
					position: relative;
					height: 36px;
					line-height: 36px;
					border-top-left-radius: 6px;
					border-top-right-radius: 6px;
					background-color: rgba(#ffffff, 0.6);
					width: 100%;
				}
			}

			.item:first-child {
				display: flex;
				flex-direction: row;
				justify-content: flex-start;
				align-items: flex-end;
				left: 0;
			}

			.item:last-child {
				display: flex;
				flex-direction: row;
				justify-content: flex-end;
				align-items: flex-end;
				right: 0;
			}

			.active {
				height: 40px;
				width: 51%;
				font-weight: bold;

				.tit-box {
					height: 40px;
					line-height: 40px;
					background-color: rgba(#ffffff, 1);
				}
			}

			.left .tit-box {
				margin-left: 12px;
				margin-right: -12px;
				padding-right: 12px;
			}

			.right .tit-box {
				margin-right: 12px;
				margin-left: -12px;
				padding-left: 12px;
			}

			.left.active .tit-box {
				margin: 0;
			}

			.right.active .tit-box {
				margin: 0;
			}

			.left.active .tit-box:after {
				content: '';
				position: absolute;
				right: -12px;
				bottom: 0;
				border-top: 12px solid transparent;
				border-right: 12px solid transparent;
				border-bottom: 36px solid #ffffff;
			}

			.right.active .tit-box:after {
				content: '';
				position: absolute;
				left: -12px;
				bottom: 0;
				border-top: 12px solid transparent;
				border-left: 12px solid transparent;
				border-bottom: 36px solid #ffffff;
			}
		}

		.wrapper {
			display: flex;
			flex-direction: column;
			flex: 1;
		}

		.address-box {
			display: flex;
			align-items: center;

			.tag {
				font-size: 24upx;
				color: $base-color;
				margin-right: 10upx;
				background: #fffafb;
				border: 1px solid #ffc107;
				border-radius: 4upx;
				padding: 4upx 10upx;
				line-height: 1;
			}

			.address {
				font-size: 30upx;
				color: $font-color-dark;
			}
		}

		.u-box {
			font-size: 28upx;
			color: $font-color-light;
			margin-top: 16upx;

			.name {
				margin-right: 30upx;
			}
		}

		.head-bottom {
			overflow: hidden;
			background: #ffffff;
			border-top-left-radius: 6px;
			border-top-right-radius: 6px;
			border-bottom-left-radius: 6px;
			border-bottom-right-radius: 6px;

			.tab {
				.t-top {
					&-box {
						margin: 0;
						padding: 12px;

						.txt1 {
							font-size: 18px;
							color: #888;
						}

						.icon1 {
							margin-left: 8px;
							color: #bbb;
						}
					}

					&-box:active {
						background-color: #f5f5f5;
					}
				}

				.t-bb {
					margin: 0 12px;
					height: 0.5px;
					background-color: #e4e7ed;
				}

				.t-bottom {
					padding: 12px;

					.row1 {
						display: flex;
						flex-direction: row;
						justify-content: space-between;

						//padding: 12px 0 0;
						.left {
							font-size: 14px;
							font-weight: bold;
						}

						.right {
							font-size: 14px;
							color: #ff9800;

							i {
								margin-left: 8px;
								color: #bbb;
							}
						}
					}

					.row2 {
						margin-top: 6px;
						font-size: 12px;
						color: #ff9800;
					}
				}
			}
		}

		.head-bottom.selectOne {
			border-top-left-radius: 0;
			border-top-right-radius: px;
		}

		.head-bottom.selectTow {
			border-top-left-radius: 6px;
			border-top-right-radius: 0;
		}
	}
	
	.login__info__item__button {
		padding: 10rpx;
		border-radius: 8rpx;
		text-align: center;
		font-size: 24rpx;
		font-weight: bold;
		justify-content: center;
		align-items: center;
	}

	.store {
		display: flex;
		flex-direction: column;

		.name {
			padding: 4px 0 0px;
			font-size: 14px;
		}

		.goods-box {
			.goods-item {
				margin-top: 20px;
				display: flex;
				flex-direction: row;

				.left {
					width: 60px;
					height: 60px;

					image {
						border-radius: 4px;
						overflow: hidden;
						width: 100%;
						height: 100%;
						background-color: #f1f1f1;
					}
				}

				.right {
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					flex: 1;
					padding-left: 14px;

					.row1 {
						display: flex;
						flex-direction: row;
						justify-content: space-between;

						.tit {
							font-size: 14px;
							color: #333333;
							font-weight: bold;
							flex: 1;
							flex-wrap: wrap;

							.zk {
								padding: 1px 3px;
								font-size: 10px;
								margin-right: 8px;
								border-radius: 4px;
								background-color: #f9221d;
								color: #ffffff;
							}
						}

						.old-price {
							padding-left: 12px;
							font-size: 14px;
							color: #888888;
							font-weight: bold;

							.lt {
								text-decoration: line-through;
							}

							.fh {
								font-size: 10px;
							}
						}

						.price {
							font-size: 16px;
							padding-left: 12px;
							color: #333333;
							font-weight: bold;

							.fh {
								font-size: 10px;
							}
						}
					}

					.row2 {}

					.row3 {
						font-size: 10px;
						color: #888888;
					}
				}
			}

			.goods-item:first-child {
				margin: 0;
			}
		}

		.peisong {
			.right {
				font-size: 14px;
				font-weight: bold;
			}

			.left {
				font-size: 16px;
				font-weight: bold;

				.fh {
					font-size: 10px;
				}
			}
		}

		.zhekou-box {
			.zhekou {
				display: flex;
				flex-direction: column;
				margin-top: 12px;

				.row1 {
					align-items: center;

					.left {
						display: flex;
						flex-direction: row;
						align-items: center;
						height: 20px;
						line-height: 20px;

						i {
							font-size: 16px;
							color: #ff5722;
						}

						.tit {
							font-weight: bold;
							margin-left: 6px;
							font-size: 14px;
							color: #333;
						}
					}

					.right {
						.tag1 {
							font-weight: bold;
							font-size: 14px;
							color: #ff5722;
						}
					}
				}

				.row2 {
					height: 20px;
					line-height: 20px;
					font-size: 12px;
					color: #888;
				}
			}

			.zhekou:first-child {
				margin: 0;
			}
		}

		.totalbox {
			align-items: flex-end;

			.left {
				display: flex;
				flex-direction: row;
				align-items: center;
				font-size: 14px;
				color: #888;

				[class*='hxicon-'] {
					color: #aaa;
					margin-left: 4px;
					font-size: 16px;
				}
			}

			.right {
				display: flex;
				flex-direction: row;
				align-items: flex-end;

				.yh {
					color: #ff5722;

					.txt {
						color: #000;
						font-size: 15px;
					}

					.fh {
						font-weight: bold;
						margin-left: 3px;
						font-size: 13px;
					}

					.num {
						font-weight: bold;
						font-size: 18px;
					}
				}

				.total {
					margin-left: 16px;
					color: #333;

					.txt {
						font-size: 15px;
					}

					.fh {
						margin-left: 3px;
						font-size: 12px;
						font-weight: bold;
					}

					.num {
						font-weight: 900;
						font-size: 22px;
					}
				}
			}
		}
	}

	.privacy {
		display: flex;
		flex-direction: column;

		.row1 {
			align-items: flex-end;

			.left {
				display: flex;
				flex-direction: row;
				align-items: center;

				.icon1 {
					color: #444;
					font-size: 24px;
				}

				.icon2 {
					color: #aaa;
					margin-left: 6px;
					font-size: 16px;
				}

				.txt {
					color: #333;
					margin-left: 6px;
					font-weight: bold;
					font-size: 14px;
				}
			}

			.right {}
		}

		.row2 {
			margin-top: 4px;
			color: #888;
			font-size: 12px;
		}

		.row3 {
			margin-top: 8px;
			font-size: 12px;
			color: #ff9800;
		}
	}

	.other-box {
		display: flex;
		flex-direction: column;

		.row {
			align-items: center;

			.left {
				font-size: 14px;
				color: #333;
				font-weight: bold;
				flex: 1;
			}

			.right {
				display: flex;
				flex-direction: column;
				justify-content: flex-end;
				align-items: center;
				flex-wrap: wrap;
				width: 60%;
				font-size: 14px;
				display: flex;
				flex-direction: row;
				color: #aaa;

				[class*='hxicon-'] {
					position: relative;
					top: 2px;
					font-size: 14px;
				}
			}
		}
	}

	.body-end {
		height: 100px;
	}

	.foot {
		z-index: 11;
		position: fixed;
		display: flex;
		flex-direction: row;
		border-radius: 50px;
		overflow: hidden;
		bottom: 12px;
		left: 12px;
		right: 12px;
		height: 50px;

		.left {
			padding: 0 12px;
			display: flex;
			flex-direction: column;
			justify-content: center;
			background-color: #222222;
			flex: 1;

			.price {
				display: flex;
				flex-direction: row;
				align-items: baseline;
				color: #fff;
				height: 25px;
				line-height: 25px;

				.fh {
					font-weight: bold;
					font-size: 12px;
				}

				.txt {
					font-size: 22px;
					font-weight: bold;
				}
			}

			.discount {
				margin-left: 2px;
				font-size: 10px;
				color: #bbb;
			}
		}

		.center {
			display: flex;
			align-items: center;
			background-color: #444;
			color: #ffc107;
			font-weight: bold;
			font-size: 16px;
			padding-left: 15px;
			padding-right: 15px;
			transition: all 0.3s;
		}

		.center:active {
			background-color: #666;
		}

		.right {
			display: flex;
			align-items: center;
			color: #222;
			font-weight: bold;
			font-size: 16px;
			padding-left: 15px;
			padding-right: 15px;
			transition: all 0.3s;
			background: linear-gradient(45deg, #ffeb3b, #ffc107);
		}

		.right:active {
			background: linear-gradient(45deg, #e0ce31, #e4ad06);
		}
	}
</style>
